package com.cloud.log.kafka.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.config.TopicBuilder;

@Configuration
public class KafkaConfig {
	
	@Bean
	public NewTopic myTopic() {
	    return TopicBuilder.name("myTopic")
	            .partitions(2)
	            .replicas(3)
	            .compact()
	            .build();
	}
	
	@Bean
	public NewTopic logTopic() {
	    return TopicBuilder.name("logTopic")
	            .partitions(10)
	            .replicas(3)
	            .compact()
	            .build();
	}
}
